package com.hexinfo.dmpro.sparing.config;

import com.alibaba.druid.pool.DruidDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * 连接池配置
 * 
 * @author
 *
 */

@Configuration
//@Slf4j
public class ConnPoolConfig {

	@Primary
	@Bean(name = "connPoolOracle")
	@ConfigurationProperties(prefix = "spring.datasource.druid")
	public DataSource connPoolOracle() {
//		log.info("-----------------oracle连接池初始化开始");
		return new DruidDataSource();
	}

	@Bean(name = "connPoolImpalaSource")
	@ConfigurationProperties(prefix = "conn.pool.impala.source")
	public DataSource connPoolImpalaSource() {
//		log.info("-----------------源IMPALA线程池初始化开始");
		return new DruidDataSource();
	}


	@Bean(name = "connPoolImpalaTarget")
	@ConfigurationProperties(prefix = "conn.pool.impala.target")
	public DataSource connPoolImpalaTarget() {
//		log.info("----------------目标IMPALA线程池初始化开始");
		return new DruidDataSource();
	}

	@Bean(name = "connPoolHiveSource")
	@ConfigurationProperties(prefix = "conn.pool.hive.source")
	public DataSource connPoolHiveSource() {
//		log.info("-----------------源hive线程池初始化开始");
		return new DruidDataSource();
	}


	@Bean(name = "connPoolHiveTarget")
	@ConfigurationProperties(prefix = "conn.pool.hive.target")
	public DataSource connPoolHiveTarget() {
//		log.info("----------------目标hive线程池初始化开始");
		return new DruidDataSource();
	}
 
}